package com.betterwood.dragon.enums;

/**
 * Created by zhengyanhua on 2021/3/30.
 */
public enum DragonFlightNews {

    BOARD("登机提醒",0),
    EXPIRE("到期提醒",1),
    LONGOUT("已离开",2);

    private String name;

    private Integer value;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    DragonFlightNews(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    //枚举方法
    public static String getDragonFlightNewsEnumName(int index){
        for(DragonFlightNews c : DragonFlightNews.values()){
            if(c.getValue()==index){
                return c.getName();
            }
        }
        return null;
    }


    //枚举方法
    public static int getDragonFlightNewsEnumIndex(String name){
        for(DragonFlightNews c : DragonFlightNews.values()){
            if(c.getName().equals(name)){
                return c.getValue();
            }
        }
        return -1;
    }
}
